<?php

  /**
   * This interface is also used to specify boolean object for preceding parameter in a method.
   * This will throw an exception when an non instance of this object is passed as argument.
   */
  interface IBoolean {

    /**
     * Returns 'true' or 'false'.
     * @return IString
     */
    function __toString();

    /**
     * Returns a primitive boolean.
     * @return boolean
     */
    function booleanValue();

    /**
     * Returns a number that represents the difference between 2 booleans.
     * Returns 0 if both are the same, 1 if 'this' Boolean is true and $boolean is false, and -1 if 'this' boolean is false and $boolean is true.
     * @param IBoolean $boolean The boolean to compare to.
     * @return IInteger The comparison result.
     * 
     */
    function compareTo(IBoolean $boolean);

    /**
     * Returns true if the string is non sensitive equal to 'true', false otherwise.
     * @static
     * @param IString $string The string to parse.
     * @return IBoolean true on success, false otherwise.
     */
    static function parseBoolean($string);
  }

?>
